Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore SELinux defaults for systemd on RHEL based #856

Merged
merged 1 commit into from
Aug 30, 2020

Conversation

tobias-urdin
Copy link
Contributor

It makes sure it's idempotent on RHEL based, needs an increase in systemd dependency to a minimum
versions of 2.10.0 to include the changes there.

Fixes: #836

@wyardley
Copy link
Contributor

@tobias-urdin can you rebase / squash, and resolve the rubocop failure?

Are there any security implications of this change?

@tobias-urdin tobias-urdin force-pushed the selinux_ignore_defaults branch from 30e87f8 to 4d68213 Compare August 24, 2020 11:56
@tobias-urdin
Copy link
Contributor Author

There is no security implications, this simply makes sure the systemd module doesn't overwrite the SELinux contexts the unit file that the installed package drops.

@tobias-urdin tobias-urdin changed the title Selinux ignore defaults Ignore SELinux defaults for systemd on RHEL based Aug 24, 2020
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess this is due to https://tickets.puppetlabs.com/browse/PUP-10548. It would be good to refer to that if that's the case.

The SELinux labels needs to be ignored by the
systemd module or it will not be idempotent.

Bump the systemd minimum version to 2.10.0

Closes: voxpupuli#836
@tobias-urdin tobias-urdin force-pushed the selinux_ignore_defaults branch from 4d68213 to 85f3be4 Compare August 24, 2020 13:48
@tobias-urdin
Copy link
Contributor Author

Fixed, the bug you linked is not really related. The issue occurs because the RabbitMQ packages built by the CentOS Messaging SIG drops the systemd unit file with the rabbitmq_unit_t context, the systemd modules then tries to overwrite that to systemd_unit_t.

@ekohl
Copy link
Member

ekohl commented Aug 24, 2020

So the RabbitMQ packages don't even provide the content so a restorecon would also revert it back to systemd_unit_t? That sounds like bad packaging. It would be good to at least mention that in the commit message, but ideally also some URL to a CentOS bug that describes it.

Other than that the PR looks good to me.

@tobias-urdin
Copy link
Contributor Author

It's not really a package bug, it's more a regression in puppet-rabbitmq that was introduced when moving to the systemd module. See the commit message on the fix back in 2015 [1].

[1] 0227f76

@ekohl
Copy link
Member

ekohl commented Aug 24, 2020

Ah, looks like I should have read the original issue. I'm always a big fan of the commit message including all of that info.

@tobias-urdin
Copy link
Contributor Author

Anything missing here or are we good?

@igalic
Copy link
Contributor

igalic commented Aug 29, 2020

an approving review (from somebody competent in SELinux / RHEL)

@ekohl ekohl merged commit f6b3a8f into voxpupuli:master Aug 30, 2020
@wyardley wyardley mentioned this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not idempotent again on RHEL based platforms since move to systemd module
4 participants